<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
    <head>
        <title>login</title>
        <script src="${pageContext.request.contextPath}/jquery/jquery-3.3.1.min.js"></script>
        <script>
            $(function () {
                $("#bt1").click(function () {
                    alert("aa");
                    var userList = new Array();
                    userList.push({username: "zf", password: 10});
                    userList.push({username: "lb", password: 20});

                    var data1 = JSON.stringify(userList);

                    $.ajax({
                        type:"POST",
                        url:"${pageContext.request.contextPath}/request/test6",
                        data:data1,
                        contentType:"application/json;charset=utf-8"
                    })

                })
            })
        </script>
    </head>
    <body>
        <input type="button" id="bt1" value="按钮">

    </body>
</html>
